﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace EPiServer.Models
{
    public class MenuLink : Link
    {
        private List<MenuLink> _subItems = new List<MenuLink>();

        public bool Expanded { get; set; }
        public List<MenuLink> SubItems 
        {
            get
            {
                return _subItems;
            }
            set
            {
                _subItems = value;
            }
        }

        public override string ToString()
        {
            return string.Format("<a href=\"{0}\">{1}</a>",LinkURL, PageName);
        }

        public string Selected(bool isSelected)
        {
            if (!isSelected)
                return ToString();

            return string.Format("<a class=\"selected\" href=\"{0}\">{1}</a>", LinkURL, PageName);
        }
    }
}